# https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
TF_A_GIT_URL			?= https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
TF_A_SITE				?= https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot
TF_A_BRANCH				?= master

TF_A_SRC_DIR			?= trusted-firmware
TF_A_GIT_DIR			?= $(TF_A_SRC_DIR)/trusted-firmware-a-repo
TF_A_VER_DIR 			?= $(TF_A_SRC_DIR)/$(TF_A_BASE)

TF_A_VERSION 			?= 2.10.0
TF_A_BASE				?= trusted-firmware-a-$(TF_A_VERSION)
TF_A_PKG 				?= $(TF_A_BASE).tar.gz


TF_A_TARGETS			?= all
TF_A_DEBUG				?= 1
TF_A_IMAGE				?= $(O_TF_A_DIR)/qemu/$(TF_A_OUTDIR)/bl1.bin

ifeq ($(TF_A_DEBUG),1)
TF_A_OUTDIR				?= debug
# LOG_LEVEL=50
TF_A_CFG_OPTS			+= LOG_LEVEL=40
else
TF_A_OUTDIR				?= release
TF_A_CFG_OPTS			+= LOG_LEVEL=0
endif


TF_A_BL32_BIN			?= $(O_OTOS_DIR)/core/tee-header_v2.bin
TF_A_BL32_EXTRA1_BIN	?= $(O_OTOS_DIR)/core/tee-pager_v2.bin
TF_A_BL32_EXTRA2_BIN	?= $(O_OTOS_DIR)/core/tee-pageable_v2.bin

TF_A_BL33_BIN			?= $(UB_IMAGE)


TF_A_BL32_BINS			= $(TF_A_BL32_BIN) $(TF_A_BL32_EXTRA1_BIN) $(TF_A_BL32_EXTRA2_BIN)
TF_A_BL3x_BINS			= $(TF_A_BL32_BINS) $(TF_A_BL33_BIN)

TF_A_IMGS += $(TF_A_IMAGE)
TF_A_IMGS += $(O_TF_A_DIR)/qemu/$(TF_A_OUTDIR)/bl32.bin
TF_A_IMGS += $(O_TF_A_DIR)/qemu/$(TF_A_OUTDIR)/bl32_extra1.bin
TF_A_IMGS += $(O_TF_A_DIR)/qemu/$(TF_A_OUTDIR)/bl32_extra2.bin
TF_A_IMGS += $(O_TF_A_DIR)/qemu/$(TF_A_OUTDIR)/bl33.bin


S_TF_A_DIR				= $(EEL_SRC_DIR)/$(TF_A_VER_DIR)
G_TF_A_DIR				= $(EEL_SRC_DIR)/$(TF_A_GIT_DIR)
O_TF_A_DIR				= $(EEL_OUT_DIR)/$(ARCH)/$(TF_A_VER_DIR)
ifneq ($(S_TF_A_DIR),$(wildcard $(S_TF_A_DIR)))
S_TF_A_DIR				= $(G_TF_A_DIR)
endif
